Program: BezSurf Release 2 Author: Eric Davies Changes: 1) I've added the ability to write out data files that can be translated to input files for various 3d modelling programs. 2) Leonard Norrgaard did a very nice job of adding the capability to modify the endpoints of segments. 3) Increased the number of grey shades available. Distribution ------------ BezSurf is public domain. Feel free to copy it, enchance it, or port it to other machines, etc. If you liked it, included it in some PD disk distribution or what not, maybe send me a post card, its real boost to the ego, especially those from overseas. Compilation ----------- Compiled under Lattice C 5.04 with the help of Jim Uhle Will also compile under Aztec 3.4a and up. Software Disclaimer ------------------- This software is free and hence comes with no guarantees. It has always worked pretty reliably for me, but since I wrote it, thats not saying much. There was some problem that seemed to go away with AmigaDos 1.2 (very embarrassing, especially since it never happened to me, probably memory shortage problems). Document Disclaimer ------------------- This document gives a partial description of BezSurf and its use. Many of the menu-items and gadgets are not described here. I believe most people will discover their purpose without too much trouble. If I'm wrong, you can query me by email (at least for a little while) at: edavies@sol.UVic.ca edavies@uvunix.bitnet (I discovered that previous address of edavies@uvvm.bitnet didn't work) Or by snail mail (if some part of Canada Post is not on strike) at: Eric Davies 214-4026 Quadra St. Victoria, B.C. Canada V8X 4E3 I've just finished my Masters, and have no idea how long my university accounts are going to hang around. If you don't get a response, or your mail bounces, when using email, try the snail mail address. But please include an email address since I can probably reply using a friends account. Description ----------- BezSurf (or Surf for short) is a program for producing bezier surfaces of revolution. It produces awesome pictures of wineglasses and doorknobs, and other objects one could turn on a lathe. BezSurf includes the capacity to map iff image files onto any surface that it can draw. History ------- I originally wrote BezSurf for my final project in an introductory course in computer graphics at the University of Victoria. The target machine was a colour Sun Work Station. Being a loyal amigoid, I ported it down to the Amiga when I had a bit more free time, the Late Night Developers supplying resources and technical assistence as needed. I proudly claim any errors or bugs as my own, following the lead of a certain wine glass manufacturer, "the minute flaws in the product are your guarantee of its handcrafted nature". Back in January of 89, Leonard Noorgaard of Finland, mailed me a diff file that added the ability to edit the endpoints of line segments. This file reached me at least two months later (the edavies@uvvm.bitnet address turned out to be a semi-blackhole), whereupon I added it to some other changes of mine. Of course, the whole thing got shelved for a long while when I started writing my thesis... Basic Usage ----------- I always run it from the Cli, but I've seen it run from the workbench without any problems. 1) press "lines". press and hold down the left mouse button. move the mouse someplace else and release the button. a line should have been rubber banded and left on the screen. repeat as desired { press and drag the mouse to define new line connected to last one line. } 2) press "curves". the endpoints of the first line should be bracked by squares. repeat as desired { bring the left mouse button near one of squares. press left button, move to new location, and release left button. nearest square should have accompanied mouse, causing the line to curve in strange and wonderful ways. press right button to move the next line. } Note: the ability to edit the end points has "enhanced" step 2 slightly, but it is a very intuitive enhancement. 3) press "panel" takes you to the control panel, so you can change the lighting, save files, etc. It is suggested that you try "tilt" with about 20 degrees ( adds a more 3d effect ). to get back to display, press [display] on the control panel. 4) press "wire" generates wireframe with hidden line removal. 5) press "shade" generates shaded image with hidden surface removal. 6) saving the images you created is done via the "files" menu in the control panel. save as... saves the ilbm to the specfied file name save first... tacks on a ".0" to the file name and saves save next... tacks on an ascending number and saves "save first" and "save next" are provided in case somebody wants to try producing animation sequences with Surf. 7) Anything else, excluding maps, should be self apparent with a little bit of experimentation. Error Messages -------------- Error messages are displayed in a requestor. If displayed, you must click in the requestor's close box to continue. The messages usually indicate that your file name is wrong, screwy file contents, you don't have enough memory, etc. Aborting a time consuming activity ---------------------------------- Under the "Image" menu, the "abort" item will terminate any drawing in progress. Mapping Iff images onto Surfaces (Grey Scale Result) -------------------------------- This is my answer to photon paints mapping of images onto spheres, cones, etc. Before you can perform the mapping, you need two things: (1) a loaded map image, and (2) a surface { not necessarily in that order though its probably better to load the image first if you are not sure you have enough memory }. Loading the map image: Go to the control panel window (see earlier discussion). Under the files menu, select the "Open Map" item. Enter the pathname of an ilbm image file (note:Ehb not supported). Wait until the hourglass goes away. Now, go and define a surface if you haven't already. Once you have both a surface defined and an image file loaded, click on the "Map" gadget on the display screen. Be prepared to wait an hour or two for your image to be produced, it is very slow. Using lots of bezier and revolution slices (ie, very small patches) results in images that look less scarred. The "MapRevV" and "MapRevH" sliders determine how many times the map image is replicated on the surface. Closing the map file frees up the memory used to store the map image file. Openning a new map file automatically closes the old one. Mapping Iff images onto Surfaces (Colour Result) -------------------------------- The idea here is to produce three different image files, one that contains the red component, one the green, and one the blue. After the files are produced, use the mergergb tool to combine them into a single file for use by the RAY2 program available from the QRT (public domain) package or DBW (shareware). procedure: set interlace and lores screen. set the grey model to "R only" load the iff image file set the screen color to "Red" (or grey). Generate the surface mapping. Save with a ".r" extension. set the grey model to "G only" load the iff image file again set the screen color to "Green" (or grey). Generate the surface mapping. Save with a ".g" extension. set the grey model to "B only". load the iff image file again. set the screen color to "Blue" (or grey). Generate the surface mapping. Save with a ".b" extension. now run the mergergb program with the filename without extensions as the sole argument. Ie, if you named the files smith.r, smith.g, and smith.b, then type: mergergb smith In this case, mergergb will produce smith.tmp, which can then be fed into RAY2. Without other arguments, RAY2 wil produce an interlaced ham image. Producing data files for Modellers ---------------------------------- Construct your object. Then select the "Write Data" menu item. A list of the points in the object will be written out. The file tov3d, is a program that will convert the data file written out to something that should be acceptable by VideoScape3d. However, the resulting datafile has never been tested since I don't have VS3d. Usage of tov3d: tov3d -maxx f -maxy f -maxz f [-minx f] [-miny f] [-minz f] [-ci inside_colour] [-co outside_colour] [-o output_filename] inputfile The object is scaled to fill the bounding box described by the min(xyz)/max(xyz) parameters [each f is a floating point number] If min value is not given, the program uses the negative of the max value. If no output file is named, the string ".v3d" is appended to the name of the input file and that is used. If you do not give either an inside colour or an outside colour, no polygons will be generated. For instance, with tov3d -maxx 3 -maxy 4.3 -maxz 10.0 -minx 2 2 -co 3 treedata the bounding box is: X = [2, 3] Y = [-4.3, 4.3] Z = [-10, 10] and the output file is treedata.v3d A Final Comment: The old version exists compiled for the 2500 using inline math operations. Does it ever fly, even when mapping. Hopefully some kind soul will do the same thing for release 2, and post it. The Future: "Son of Surf" ?